package com.dd.dao;

import java.sql.*;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.dd.entity.*;

public class DdFirstPageDAO  extends HibernateDaoSupport {
	private static final Log log = LogFactory.getLog(DdFirstPageDAO.class);
	public void saveOrUpdate(DdFirstPage transientInstance) {
		log.debug("saving DdFirstPage instance");
		try {
			getHibernateTemplate().saveOrUpdate(transientInstance);
			log.debug("save successful");
		} catch (RuntimeException re) {
			log.error("save failed", re);
			throw re;
		}
	}
	public List findAll() {
		log.debug("findAll instance");
		try {
			return getHibernateTemplate().find("from DdFirstPage");
		} catch (RuntimeException re) {
			log.error("save failed", re);
			throw re;
		}
	}
	public List findByType(int type) {
		log.debug("findByType instance");
		try {
			return getHibernateTemplate().find("from DdFirstPage where types="+type);
		} catch (RuntimeException re) {
			log.error("save failed", re);
			throw re;
		}
	}
}
